package com.nbcio.pm.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.nbcio.common.tenant.core.TenantEntity;
import com.nbcio.pm.domain.vo.PmTaskDependencyVo;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 任务依赖对象 pm_task_dependency
 *
 * @author nbacheng
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("pm_task_dependency")
@AutoMapper(target = PmTaskDependencyVo.class, reverseConvertGenerate = false)
public class PmTaskDependency extends TenantEntity {

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 前置任务ID
     */
    @TableField("predecessor_id")
    private Long predecessorId;

    /**
     * 后续任务ID
     */
    @TableField("successor_id")
    private Long successorId;

    /**
     * 依赖类型：finish_to_start-完成到开始，start_to_start-开始到开始，finish_to_finish-完成到完成，start_to_finish-开始到完成
     */
    @TableField("dependency_type")
    private String dependencyType;

    /**
     * 延迟天数
     */
    @TableField("lag_days")
    private Integer lagDays;

    // 关联字段（非数据库字段）
    @TableField(exist = false)
    private String predecessorName;

    @TableField(exist = false)
    private String successorName;
}
